﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyThiTracNghiem
{
    public partial class frmChuongTrinhChinh : Form
    {
        public frmChuongTrinhChinh()
        {
            InitializeComponent();
            DataTable dt = new DataTable();
            dt = BUS.clsTest.LayDuLieu();
            dt.Columns.Add("STT");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["STT"] = i + 1;
            }
            
            dataGridView1.DataSource = dt.DefaultView;
            dataGridView1.Columns["STT"].DisplayIndex = 0;
            dataGridView1.Columns["STT"].Frozen = true;
            dataGridView1.Columns["STT"].Width = 50;
            //this.dataGridView1.EnableHeadersVisualStyles = true;

        }

        private void frmChuongTrinhChinh_Load(object sender, EventArgs e)
        {
            VisibleMethod(true);
        //    MessageBox.Show();
        }

        private void mnuThoat_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnDangNhap_Click(object sender, EventArgs e)
        {
            VisibleMethod(false);
        }

        private void VisibleMethod(bool b)
        {
            this.pnlDangNhap.Visible = b;
            this.gbxThongTinSinhVienLamBai.Visible = !b;
        }

        private void btnQuayLai_Click(object sender, EventArgs e)
        {
            VisibleMethod(true);
        }

        private void btnHuy_Click(object sender, EventArgs e)
        {
            this.txtTaiKhoan.Text = "";
            this.txtMatKhau.Text = "";
        }
    }
}
